<?php
/**
 * 积分管理
 *
 * @网店运维提供技术支持 授权请购买shopnc授权
 * @license    http://www.shopwwi.com
 * @link       交流群号：111731672
 */



defined('InShopNC') or exit('Access Invalid!');
class member_pointsControl extends mobileMemberControl {
    public function __construct(){

        parent::__construct();

    }

    /**
     * 积分日志列表
     */
    public function pointslogOp(){
	
        $condition_arr = array();
        $condition_arr['pl_memberid'] = $_SESSION['member_id'];
        if ($_GET['stage']){
            $condition_arr['pl_stage'] = $_GET['stage'];
        }
        $condition_arr['saddtime'] = strtotime($_GET['stime']);
        $condition_arr['eaddtime'] = strtotime($_GET['etime']);
        if($condition_arr['eaddtime'] > 0) {
            $condition_arr['eaddtime'] += 86400;
        }


            switch ($condition_arr['pl_stage']) {

                case 'regist':

                    $condition_arr['stagetext'] = array('like', '%' . trim($keyword) . '%');

                    break;

                case 'login':

                    $condition_arr['stagetext'] = array('like', '%' . trim($keyword) . '%');

                    break;

                case 'comments':

                    $condition_arr['stagetext'] = intval($keyword);

                    break;

            }
        $condition_arr['pl_desc_like'] = $_GET['description'];

        //查询积分日志列表
        $points_model = Model('points');
        $log_list = $points_model->getPointsLogList($condition_arr,$this->page,'*','');
		
        $page_count = $points_model->gettotalpage();
        output_data(array('log_list' => $log_list), mobile_page($page_count));

    }


	              	
 

}
